package com.nbjtjc.safe.api.safe;

import com.nbjtjc.safe.bean.Result;
import com.nbjtjc.safe.model.safe.SafeDangerInspectRecord;
import com.nbjtjc.safe.model.safe.SafeDangerInspectTaskRecord;
import com.nbjtjc.safe.service.safe.SafeDangerInspectRecordServiceImpl;
import com.nbjtjc.safe.service.safe.SafeDangerInspectTaskRecordServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * 巡检记录
 * @time 2021-11-2
 */
@RestController
@RequestMapping("/safe/inspectRecord")
@CrossOrigin("*")

public class SafeDangerInspectRecordController {

    @Autowired
    private SafeDangerInspectTaskRecordServiceImpl taskRecordService;

    @Autowired
    private SafeDangerInspectRecordServiceImpl inspectRecordService;
    @GetMapping("/getTaskInfo")
    public Result getTaskInfo(){
        return taskRecordService.getTaskRecordInfo();
    }

    @PostMapping("/add")
    public Result add(@RequestBody SafeDangerInspectTaskRecord taskRecord){
        return taskRecordService.add(taskRecord);
    }

    @PostMapping("/search")
    public Result search(@RequestBody SafeDangerInspectRecord inspectRecord){
        return inspectRecordService.search(inspectRecord);
    }

    @PostMapping("/doTask")
    public Result doTask(@RequestBody SafeDangerInspectTaskRecord taskRecord){
        return taskRecordService.doTask(taskRecord);
    }

}
